<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>

		<p:fieldset legend="Create" toggleable="true" toggleSpeed="500"
			collapsed="true">

			<p:outputPanel style="text-align:center;">
				<p:panelGrid columns="3" columnClasses="label,value">
					<h:outputText value="Project/Department" />
					<p:selectOneMenu id="projectId" value="#{createPurchaseRequisitionBean.projectId}"
						required="true" requiredMessage="Please select a project/department!"
						style="width:125px">
						<f:selectItem itemLabel="Select One" itemValue="" />
						<f:selectItems var="project" value="#{createPurchaseRequisitionBean.projects}" 
							itemLabel="#{project.code} : #{project.description}" itemValue="#{project.id}" />
					</p:selectOneMenu>
					<h:message for="projectId" style="color:red" />

					<h:outputText value="Description" />
					<h:inputText id="description" value="#{createPurchaseRequisitionBean.description}"
						required="true" requiredMessage="Description is mandatory!" />
					<h:message for="description" style="color:red" />

				</p:panelGrid>

				<br />
				<p:commandButton value="Create Purchase Requisition" update="@form"
					action="#{createPurchaseRequisitionBean.create}" />

			</p:outputPanel>

		</p:fieldset>
	</ui:composition>
</body>
</html>